-- @owner: @kyeleze
-- @date: 2022/5/13
-- @testpoint: 验证自定义类型转换函数名不符合命名规则,包含特殊字符; 合理报错

--step1:建立自定义类型转换函数;expect:合理报错
create or replace function _timezone_to_secondsinteger@
(
    in time with time zone
)
returns integer
as
$$
declare
seconds integer;
begin
select (
extract(hour from $1)::integer * 3600
+ extract(minute from $1)::integer * 60
+ extract(seconds from $1)::integer* 1) into seconds;
return seconds;
end;
$$ language plpgsql;
/
